package com.hqyj.entity;

public class SearchBean {
    public final static int DEFAULT_PAGE_SIZE = 5;
    public final static int DEFAULT_CURRENT_SIZE = 1;
    private int currentPage;
    private int pageSize;
    private String orderBy;
    private String direction;
    private String keyword;

    public void initSearchBean(){
        if(this == null){
            return;
        }
        this.currentPage = this.currentPage == 0 ? DEFAULT_CURRENT_SIZE : this.currentPage;
        this.pageSize = this.pageSize == 0 ?  DEFAULT_PAGE_SIZE : this.pageSize;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyWord) {
        this.keyword = keyWord;
    }
}
